import axios from "axios";
export function getDataList(data) {
  return axios({
    url: "http://localhost:3001/data",
    method: "Get",
    params: data,
  });
}

export function addDataList(data) {
  return axios({
    url: "http://localhost:3001/data",
    method: "POST",
    data,
  });
}

export function updataDataList(data) {
  return axios({
    url: `http://localhost:3001/data/${data.id}`,
    method: "PUT",
    data,
  });
}
export function ReturnList(id) {
  return axios({
    url: `http://localhost:3001/data/${id}`,
    method: "GET",
  });
}
export function SearchList(val) {
  return axios({
    url: `http://localhost:3001/data/?name=${val}`,
    method: "GET",
  });
}
export function DeleteDataList(id) {
  return axios({
    url: `http://localhost:3001/data/${id}`,
    method: "DELETE",
  });
}
